package mumu.android.animate;

import mumu.android.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.ViewGroup.LayoutParams;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;

/**
 * 透明度
 * 
 * @author Administrator
 * 
 */
public class alpha extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		/**
		 * 参数1: 起始透明度; 参数2: 目标透明度;
		 */
		Animation animation = new AlphaAnimation(1f, 0.1f);
		animation.setDuration(1000);
		ImageView imageView = new ImageView(this);
		imageView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
		imageView.setImageResource(R.drawable.image_indicator);
		// 匀速效果
		LinearInterpolator lInterpolator = new LinearInterpolator();
		// 加速效果
		AccelerateInterpolator aInterpolator = new AccelerateInterpolator();
		// 减速效果
		DecelerateInterpolator dInterpolator = new DecelerateInterpolator();
		animation.setInterpolator(lInterpolator);
		imageView.startAnimation(animation);
		setContentView(imageView);
	}

}
